<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Escort_user_roles_n_zones_m extends MY_Model {
	protected $_table = 'escort_user_roles_n_zones';
	public function getCountryIdOfCountryManager($username){
		$this->db->select('country_id');
		//$this->db->select('escort_user_roles_n_zones.*');
		$this->db->where('username', $username);
		$this->db->distinct('country_id');
		$this->db->order_by('country_id', 'DESC');
		return $this->db->get('escort_user_roles_n_zones')->result();
	}
	public function getUsernameOfCountryList($countryIdList, $group){
		$this->db->select('username');
		//$this->db->select('escort_user_roles_n_zones.*');
		$this->db->where('group', $group);
		$this->db->where_in('country_id', $countryIdList);
		$this->db->distinct('username');
		$this->db->order_by('country_id', 'DESC');
		return $this->db->get('escort_user_roles_n_zones')->result();
	}
	public function getUserZoneBy($group, $country_id){
		$this->db->where('group', $group);
		$this->db->where('country_id', $country_id);
		return $this->db->get('escort_user_roles_n_zones')->result();
	}
}
?>
